const fs = require("fs")
const path = require("path")

module.exports = (req,res)=>{
    let file = req.files
    const baseurl = 'http://127.0.0.1:3000/uploads/'
    let data =[]
    for(let i in file){
       var url =  file[i].path.split('uploads\\')[1]
       url=baseurl+url
      data.push({
          url,
          alt: "",
          href: ""
      })
    }
    res.send({
        errno:'0',
        data
    })
}